package com.supergo.manager.controller;

import com.supergo.manager.service.ItemCatService;
import com.supergo.pojo.Itemcat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Classname ItemCatController
 * @Description TODO
 * @Date 2020/10/26 21:06
 * @Created by ccc-j
 * @email ccc-ju@outlook.com
 */
@RestController
public class ItemCatController {

    @Autowired
    private ItemCatService itemCatService;

    @RequestMapping("/cat/category")
    public List<Itemcat> getItemCatList(){
        return itemCatService.getItemCatList();
    }

    @RequestMapping("/itemcat/category/{categoryId}")
    public Itemcat getItemCatById(@PathVariable Long categoryId){
        Itemcat itemcat = itemCatService.findOne(categoryId);
        return itemcat;
    }



}
